﻿using System;
using System.Collections.Generic;
using System.Data;

namespace Loki.Data
{
    /// <summary>
    /// Interface for database commands.
    /// </summary>
    public interface IDatabaseCommand
    {
        /// <summary>
        /// Adds a data parameter.
        /// </summary>
        /// <param name="P_Parameter">The data parameter.</param>
        void AddParameter(IDataParameter P_Parameter);

        /// <summary>
        /// Adds a data parameter.
        /// </summary>
        /// <typeparam name="T">The value type.</typeparam>
        /// <param name="P_ValueName">The parameter name.</param>
        /// <param name="P_Value">The parameter value.</param>
        void AddParameter<T>(string P_ValueName, T P_Value);

        /// <summary>
        /// Adds a data parameter.
        /// </summary>
        /// <typeparam name="T">The value type.</typeparam>
        /// <param name="P_ValueName">The parameter name.</param>
        /// <param name="P_Value">The parameter value.</param>
        /// <param name="P_DefaultValue">The parameter defaut value.</param>
        void AddParameter<T>(string P_ValueName, T P_Value, Func<T> P_DefaultValue);

        /// <summary>
        /// Gets the command name.
        /// </summary>
        string Name
        {
            get;
        }

        /// <summary>
        /// Gets the command parameters.
        /// </summary>
        IEnumerable<IDataParameter> Parameters
        {
            get;
        }

        /// <summary>
        /// Gets the command type.
        /// </summary>
        CommandType Type
        {
            get;
        }

        /// <summary>
        /// Dump the command.
        /// </summary>
        string Dump();
    }
}
